#Prepare the log files
require 'erb'

before "deploy:setup", :prepare_log_files
#after "deploy:update_code", "prepare_chacheable:append_log_and_change_perms" 

namespace :prepare_log_files do
  desc "Create an empty and change perms for base.css and base_js.js" 
  task :default do
    run "mkdir -p #{shared_path}/log/" 
    run "echo Prodution Log prepared >> #{shared_path}/log/production.log"
    run "chmod 666 #{shared_path}/log/production.log"
  end
  
  desc "Make caheable css and JS cacheable" 
  task :append_log_and_change_perms do
    
    #run "mkdir -p #{shared_path}/public/stylesheets/" 
    #run "mkdir -p #{release_path}/public/javascripts/" 
    
    #put css.result, "#{release_path}/public/stylesheets/base.css" 
    #put js.result, "#{release_path}/public/javascripts/base_js.js"
    #run "chmod 666 #{release_path}/public/stylesheets/" 
    #run "chmod 666 #{release_path}/public/javascripts/" 
    
  end
end